package com.xoa.controller.equipment;


import com.xoa.model.equipment.LimsEquipFile;
import com.xoa.model.equipment.LimsEquipParts;
import com.xoa.service.equipment.EquipmentAcceService;
import com.xoa.util.LimsJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @作者 王穗穗
 * @创建日期 13:25 2020/1/8
 * @类介绍   设备台账下设备配件和设备附件操作表控制器
 */
@Controller
@RequestMapping("/EquipmentAccess")
public class EquipmentAccessController {

    @Autowired
    private EquipmentAcceService equipmentAcceService;

    @RequestMapping("/EquipAccessItems")
    @ResponseBody
    public LimsJson EquipAccessItems(String equipNo, Integer equipId){
        return equipmentAcceService.EquipAccessItems(equipNo,equipId);
    }

    @RequestMapping("/getEquipAccess")
    @ResponseBody
    public LimsJson getEquipAccess(Integer equipId, Integer page, Integer limit){
        return equipmentAcceService.getEquipAccess(equipId, page, limit);
    }

    @RequestMapping("/operationEquipAccess")
    @ResponseBody
    public LimsJson operationEquipAccess(LimsEquipParts limsEquipParts){
        return equipmentAcceService.operationEquipAccess(limsEquipParts);
    }

    @RequestMapping("/delEquipAccess")
    @ResponseBody
    public LimsJson  delEquipAccess(String partIds){
        return equipmentAcceService.delEquipAccess(partIds);
    }


    @RequestMapping("/getEquipFile")
    @ResponseBody
    public LimsJson  getEquiFile(Integer equipId, Integer page, Integer limit){
        return equipmentAcceService.getEquiFile(equipId, page, limit);
    }

    @RequestMapping("/operationEquiFile")
    @ResponseBody
    public LimsJson operationEquiFile(HttpServletRequest request, LimsEquipFile limsEquipFile){
        return equipmentAcceService.operationEquiFile(request,limsEquipFile);
    }

    @RequestMapping("/delEquiFile")
    @ResponseBody
    public LimsJson delEquiFile(String fileIds) {
        return equipmentAcceService.delEquiFile(fileIds);
    }


}
